package cn.boysoft.core.spring;

import java.io.IOException;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.ResourceEntityResolver;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
 * 
 * @author 付厚俊
 * CreateTime 2013-4-4 下午5:09:32
 */
public class JeeXmlApplicationContext extends ClassPathXmlApplicationContext{
	public JeeXmlApplicationContext(String[] location){
		super(location);
	}
	protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory)
    throws BeansException, IOException{
    XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory);
    beanDefinitionReader.setEventListener(new ComponentRegisterCompleteListener());
    beanDefinitionReader.setResourceLoader(this);
    beanDefinitionReader.setEntityResolver(new ResourceEntityResolver(this));
    initBeanDefinitionReader(beanDefinitionReader);
    loadBeanDefinitions(beanDefinitionReader);
  }
}
